//初始化form表单中的下拉框
function initSelect(selectId,url,selectValue,selectName) {
    $.ajax({
        async: false,
        type: "GET",
        url: url,
        dataType: "json",
        data: {},
        success: function (res) {
            var opt = "<option value='' selected = \'selected\'>全部</option>";
            $("select[name="+selectId+"]").append(opt);
            for(var i=0; i<res.length; i++){
                var option="<option value=\""+res[i][selectValue]+"\"";
                       option += ">"+res[i][selectName]+"</option>"; //动态添加数据
                $("select[name="+selectId+"]").append(option);
            }
            layui.form.render('select','boardFilter');
        }
    });
}

//批量删除获取ids
function getIds(data) {
    var ids = '';
    for(var x=0;x<data.length;x++){
        ids = ids + data[x].id + ',';
    }
    return ids+'0';
}